import * as model from "drizzle-orm/sqlite-core";
export enum ETaskPriority {
  DEFAULT = "6005",
  IMPORTANT_AND_URGENT = "6007",
  IMPORTANT_BUT_NOT_URGENT = "6008",
  NOT_IMPORTANT_BUT_URGENT = "6009",
  NOT_IMPORTANT_AND_NOT_URGENT = "6010",
}

const taskEntity = model.sqliteTable("tasks", {
  id: model.integer("id").primaryKey({ autoIncrement: true }), // 任务ID
  title: model.text("title").notNull(), // 任务标题
  content: model.text("content", { length: 100 }).notNull(), // 任务内容
  priority: model
    .text("priority", { enum: Object.values(ETaskPriority) as [string, ...string[]] })
    .default(ETaskPriority.DEFAULT)
    .notNull(), // 任务优先级
  status: model.integer("status", { mode: "boolean" }).default(false).notNull(), // 任务状态"
  createdAt: model.integer("createTime", { mode: "timestamp" }), // 任务创建时间
  isProxy: model.integer("isProxy", { mode: "boolean" }).default(false).notNull(), // 是否云端更新
  isDeleted: model.integer("isDeleted", { mode: "boolean" }).default(false).notNull(), // 任务是否删除
});



export { taskEntity };
